/*
 * @Author: liuzehai
 * @Date: 2021-04-22 11:26:20
 * @LastEditTime: 2021-05-17 15:20:23
 * @LastEditors: liuzehai
 * @FilePath: /Card-to-payh5/src/router/index.js
 * @Description: 由liuzehai创建！
 */
import Vue from 'vue';
import VueRouter from 'vue-router';
const Layout = () => import('@/layout/index');

Vue.use(VueRouter)

const standalonePage = [

]

const clonePages = [];
standalonePage.forEach(e => {
  let obj = {};
  obj.path = e.path + '_ios',
  obj.name = e.name;
  obj.meta = e.meta;
  obj.component = e.component;
  clonePages.push(obj);
});

const routes = [
  /** 含子页面，iOS配置项 */
  {
    path: '/',
    name: 'App',
    redirect: '/home',
    component: Layout,
    children: [{
        path: '/home',
        name: 'Home',
        component: () => import('@/views/home'),
        meta: {
          title: '首页',
          root: true,
        },
      },
      {
        path: '/mine',
        name: 'mine',
        component: () => import('@/views/mine'),
        meta: {
          title: '我的',
          root: true,
        }
      },
      {
        path: '/record',
        name: 'record',
        component: () => import('@/views/record'),
        meta: {
          title: '记录',
          root: true,
        }
      },
    ].concat(clonePages),
  },
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes: standalonePage.concat(routes),
})

export default router